	{
    class Game extends Sail.Scene {
        constructor(data) {
            super();

            this.roomNo = null;
            this.map = null;
            this.controlView = null;
            this.control = null;

            this.initComponent();
        }

        destoryEvent() {
            this.controlView && this.controlView.destoryEvent();
            this.control && this.control.destoryEvent();
        }

        initComponent() {
            //添加地图
            this.map = new Com.Room.Map.FactionBattle();
            this.addChild(this.map);

            //添加控制界面
            this.controlView = new Com.Room.GameControlView();
            this.addChild(this.controlView);

            //添加控制器
            this.control = new Ctrl.Room.Game();
        }

        //初始化界面
        //{"cmd":"enter","code":0,"res":[{"camp":1,"uid":2037587422,"uname":"ce***01","hero":1,"x":72,"y":1368,"mx":1,"my":0,"m":0}]}
        init(data) {
            this.roomNo = data.roomNo;

            this.control.init(data.roomNo, this.controlView);
            this.control.on('game_end', this, this.gameOver);

            data.player.forEach(function (roles) {
                roles.forEach(function (role) {
                    let camp = role.camp == 'red' ? 1: -1;
                    this.control.createRole(role, camp);
                }, this)
            }, this);

            if (GM.debug) {
                Sail.io.publish('start', 0);
                return;
            }

            Sail.io.emit('start', { roomNo: this.roomNo });
        }


        //游戏结束
        gameOver(data) {
            this.map.reset();
            this.destoryEvent();

            setTimeout(function() {
                Laya.loader.load(ASSETS.SETTLE, Laya.Handler.create(null, function () {
                    Sail.director.runScene(new Scene.Settle(data));
                }));
            }, 200);
        }
    }

    Sail.class(Game, "Scene.Game");
}